#include <iostream>
#include <list>
#include <string>
using namespace std;
class Solution {
public:
  string toHex(int num) {
    if (num == 0)
      return "0";
    char tab[] = {'0', '1', '2', '3', '4', '5', '6', '7',
                  '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
    std::list<char> restmp;
    unsigned int a = num;
    while (a != 0) {
      restmp.push_front(tab[a % 16]);
      a = a / 16;
    }
    string res;
    for (auto p = restmp.begin(); p != restmp.end(); ++p) {
      res.push_back(*p);
    }
    return res;
  }
};

int main(int argc, char *argv[]) {
  Solution s;
  cout << s.toHex(-1) << endl;
  return 0;
}
